#ifndef GPIO_CONFIG
#define GPIO_CONFIG

#define GPIOA_Enable() RCC->APB2ENR |= 0x00000004
#define GPIOB_Enable() RCC->APB2ENR |= 0x00000008
#define GPIOC_Enable() RCC->APB2ENR |= 0x00000010
#define GPIOD_Enable() RCC->APB2ENR |= 0x00000020
#include <stm32f10x.h>
unsigned char GPIO_config(GPIO_TypeDef *GPIO, unsigned char bit_num, unsigned int mode);

//最大输出速度为50MHz
#define GP_PP 0x00000003
#define GP_OD 0x00000007
#define AF_PP 0x0000000B
#define AF_OD 0x0000000F
//最大输出速度为10MHz
/*
#define GP_PP 0x00000001
#define GP_OD 0x00000005
#define AF_PP 0x00000009
#define AF_OD 0x0000000D
*/
//最大输出速度为2MHz
/*
#define GP_PP 0x00000002
#define GP_OD 0x00000006
#define AF_PP 0x0000000A
#define AF_OD 0x0000000E
*/
#define Anlog 0x00000000
#define NC_In 0x00000004
#define PD_In 0x00000008
#define PU_In 0x0000000C //上拉输入的标志

#endif
